import MySQLdb

db = MySQLdb.connect(host = "localhost", user = "root", passwd="", db="fak")
cursor = db.cursor()

#Execute SQL Statement:
cursor.execute("SELECT PCTNo FROM auip_wipo_sample WHERE PCTNo IN (SELECT PCTNo FROM auip_wipo_1)")

#Get the result set as a tuple:
result = cursor.fetchall()

#Iterate through results and print:
for record in result:
    print record


#Finish dealing with the database and close it
db.commit()
db.close()

